
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>amCharts examples</title>
  
  		<script src="../components/jquery-ui/jquery-1.2.6.js" type="text/javascript"></script>        
        <link rel="stylesheet" href="../components/newChart/style.css" type="text/css">
        <script src="../components/newChart/amcharts/amcharts.js" type="text/javascript"></script>
        <script src="../components/newChart/amcharts/serial.js" type="text/javascript"></script>
  			
        <script>  
            
        $(function(){
        	$.ajax({
        		type:'get',
        		dataType:'json',
        		url:'statChartAction_getonlineinfo',
        		success:function(data){
        			var chartData = data;  
        			               var chart;  
        			     
        			                   chart = new AmCharts.AmSerialChart();  
        			                   chart.dataProvider = chartData;//数据  
        			                   chart.categoryField = "time";//横坐标  
        			     
        			                   var graph = new AmCharts.AmGraph();  
        			                   graph.valueField = "number";//纵坐标  
        			                   graph.type = "line";//表示折线图  
        			                   graph.fillAlphas = 0; // 或者删除这一行, 因为0是默认值  
        			                   graph.bullet = "round";  
        			                   graph.lineColor = "#8d1cc6";//线的颜色  
        			                   graph.balloonText = "[[time]]: <b>[[value]]</b>";//添加气球  
        			                   chart.addGraph(graph);  
        			                     
        			                   var categoryAxis = chart.categoryAxis;  
        			                   categoryAxis.autoGridCount  = true;  
        			                   categoryAxis.gridCount = chartData.length;  
        			                   categoryAxis.gridPosition = "start";  
        			                     
        			                   categoryAxis.labelRotation = 90;  
        			                     
        			                     
        			                   // WRITE  
        			                   chart.write("chartdiv");  
        			
        		}
        	});
        })
        
        
        
        </script>  
    </head>  
  
    <body>  
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>  
    </body>  
  
</html>  